package com.ganbo.pattern.facade;

import com.ganbo.pattern.facade.subsystem.Cpu;
import com.ganbo.pattern.facade.subsystem.Disk;
import com.ganbo.pattern.facade.subsystem.Memory;

/**
 * 门面类（核心）
 *
 * @Author: ganbo
 * @Date: 2020/6/11 14:48
 */
public class Computer {

    private Cpu cpu;
    private Disk disk;
    private Memory memory;

    public Computer() {
        this.cpu = new Cpu();
        this.disk = new Disk();
        this.memory = new Memory();
    }


    public void start() {
        System.out.println("====Computer Start Begin...");
        cpu.start();
        disk.start();
        memory.start();
        System.out.println("====Computer Start end.");
    }

    public void shutdown() {
        System.out.println("Computer shutdown start...");
        cpu.shutdown();
        disk.shutdown();
        memory.shutdown();
        System.out.println("Computer shutdown end.");
    }
}
